// lazy
// React.lazy 是一个用于实现懒加载组件的工具，它允许你动态地加载组件，从而提高应用的性能和启动速度。
// 当你使用 React.lazy 时，组件会在需要时才被加载，而不是在初始加载时就全部加载。
import React, { lazy } from "react";
// 引入布局组件
import Layouts from '../components/Layouts/Layouts'

// 引入定义的类型
import { RouterArr } from "../type";
import { ProjectOutlined, InboxOutlined, PlusCircleOutlined, UserOutlined, SubnodeOutlined, PlusSquareOutlined, RadarChartOutlined } from '@ant-design/icons';
// 引入页面二级路由

const Designtools = lazy(() => import('../pages/Designtools/index'))
const Templatecenter = lazy(() => import('../pages/Templatecenter/index'))
const ImageCon = lazy(() => import('../pages/imageCon/index'))
const Createteam = lazy(() => import('../pages/Createteam/index'))
const Mydesign = lazy(() => import('../pages/Mydesign/index'))
const CreateDesign = lazy(() => import('../pages/CreateDesign/index'))
const Makerpost = lazy(() => import('../pages/Makerpost/index'))
const IntelligentDesign = lazy(() => import('../pages/IntelligentDesign/index'))
const IntelligentImage = lazy(() => import('../pages/IntelligentImage/index'))
const ImageEdit = lazy(() => import('../pages/ImageEdit/index'))
const EnterpriseDesignServices = lazy(() => import('../pages/EnterpriseDesignServices/index'))
const PrintProduction = lazy(() => import('../pages/PrintProduction/index'))
const DownloadApp = lazy(() => import('../pages/DownloadApp/index'))
const BatchDesign = lazy(() => import('../pages/BatchDesign/index'))
const DesignImg = lazy(() => import("../pages/DesignImg/index"))
const MaterialCenter = lazy(() => import("../pages/MaterialCenter/index"))
const OrderInvoice = lazy(() => import("../pages/OrderInvoice/index"))
const TemplateManagement = lazy(() => import("../pages/TemplateManagement/index"))
const OrderManagement = lazy(() => import("../pages/OrderManagement/index"))
const GBRecharge = lazy(() => import("../pages/GBRecharge/index"))
const Corporate = lazy(() => import("../pages/Corporate/index"))

const Login = lazy(() => import('../pages/Login/index'))
const Sigin = lazy(() => import('../pages/Sigin/index'))
const User = lazy(() => import('../pages/User/index'))
// 2级路由
export const RouterOrderList: RouterArr[] = [
    {
        path: '/orderInvoice/gBRecharge',
        element: <GBRecharge></GBRecharge>,
        meta: {
            label: '果币充值',
        },

    },
    {
        path: '/orderInvoice/orderManagement',
        element: <OrderManagement></OrderManagement>,
        meta: {
            label: '订单管理',
        }
    },
    {
        path: '/orderInvoice/templateManagement',
        element: <TemplateManagement></TemplateManagement>,
        meta: {
            label: '商品管理',
        }
    },
]

// 2级路由
export const RouterList: RouterArr[] = [
    {
        path: '/',
        element: <Layouts><Designtools></Designtools></Layouts>,
        meta: {
            label: '为你推荐',
            icon: <ProjectOutlined />,
            roles: ['user', 'admin']
        },
        // children: RouterListChildren
    },
    {
        path: '/templatecenter',
        element: <Layouts><Templatecenter></Templatecenter></Layouts>,
        meta: {
            label: '模版中心',

            icon: <InboxOutlined />,
            roles: ['user', 'admin']
        }
    },
    {
        path: '/imageCon',
        element: <Layouts><ImageCon></ImageCon></Layouts>,
        meta: {
            label: '素材中心',

            icon: <PlusCircleOutlined />,
            roles: ['user', 'admin']
        }
    },
    {
        path: '/createteam',
        element: <Layouts><Createteam></Createteam></Layouts>,
        meta: {
            label: '创建设计',

            icon: <SubnodeOutlined />,
            roles: ['user', 'admin'],
        },

    },
    {
        path: '/mydesign',
        element: <Layouts><Mydesign></Mydesign></Layouts>,
        meta: {
            label: '我的设计',

            icon: <UserOutlined />,
            roles: ['user', 'admin']
        },
    },
    {
        path: '/materialCenter',
        element: <Layouts><MaterialCenter></MaterialCenter></Layouts>,
        meta: {
            label: '我的素材',
            icon: <PlusSquareOutlined />,
            roles: ['user', 'admin']
        }
    },
    {
        path: '/createDesign',
        element: <Layouts><CreateDesign></CreateDesign></Layouts>,
        meta: {
            label: '创建团队',
            icon: <PlusSquareOutlined />,
            roles: ['user', 'admin']
        }
    },
    {
        path: '/makerpost',
        element: <Makerpost></Makerpost>,
        meta: {
            label: '创客贴AI',
            icon: <RadarChartOutlined />,
        }
    },
    {
        path: '/enterpriseDesignServices',
        element: <EnterpriseDesignServices></EnterpriseDesignServices>,
        meta: {
            label: '企业设计服务',
            hide: true
            // roles: ['user', 'admin']
        },
    },
    {
        path: '/printProduction',
        element: <PrintProduction></PrintProduction>,
        meta: {
            label: '印刷制作',
            hide: true
            // roles: ['user', 'admin']
        },
    },
    {
        path: '/downloadApp',
        element: <DownloadApp></DownloadApp>,
        meta: {
            label: '下载App',
            hide: true,
            roles: ['user', 'admin']
        },
    },
    {
        path: '/intelligentDesign',
        element: <IntelligentDesign></IntelligentDesign>,
        meta: {
            label: '智能设计',
            icon: <UserOutlined />,
        }
    },
    {
        path: '/IntelligentImage',
        element: <IntelligentImage></IntelligentImage>,
        meta: {
            label: '智能抠图',
            icon: <UserOutlined />,
        }
    },
    {
        path: '/ImageEdit',
        element: <ImageEdit></ImageEdit>,
        meta: {
            label: '图片编辑',
            icon: <UserOutlined />,
        }
    },
    {
        path: '/batchDesign',
        element: <BatchDesign></BatchDesign>,
        meta: {
            label: '批量设计',
            icon: <UserOutlined />,
        }
    },
    {
        path: '/enterpriseDesignServices',
        element: <EnterpriseDesignServices></EnterpriseDesignServices>,
        meta: {
            label: '企业设计服务',
            hide: true
            // roles: ['user', 'admin']
        },
    },
    {
        path: '/printProduction',
        element: <PrintProduction></PrintProduction>,
        meta: {
            label: '印刷制作',
            hide: true
            // roles: ['user', 'admin']
        },
    },
    {
        path: '/downloadApp',
        element: <DownloadApp></DownloadApp>,
        meta: {
            label: '下载App',
            hide: true,
            roles: ['user', 'admin']
        },
    },
    {
        path: '/makerpost',
        element: <Makerpost></Makerpost>,
        meta: {
            label: '创客贴AI',
            hide: true
        }
    },
    {
        path: '/login',
        element: <Login></Login>,
        meta: {
            label: '登录',
            hide: true
        }
    },
    {
        path: '/sigin',
        element: <Sigin></Sigin>,
        meta: {
            label: '注册',
            hide: true
        }
    },
    {
        path: '/user',
        element: <User></User>,
        meta: {
            label: '我的',
            hide: true
        }
    },
    {
        path: '/designimg',
        element: <DesignImg></DesignImg>,
        meta: {
            label: '设计图片',
            hide: true
        }
    },
    {
        path: '/orderInvoice',
        element: <OrderInvoice></OrderInvoice>,
        meta: {
            label: '订单发票',
            hide: true,
        },
        children: RouterOrderList
    },

    {
        path: '/corporate',
        element: <Corporate></Corporate>,
        meta: {
            label: '企业服务',
            hide: true
        }
    },
]




